using System;
using System.Collections.Generic;
using System.Text;

namespace Anarchy.FS
{
    public class DirectoryInfo
    {

        // Variables
        public Dictionary<int, DirectoryInfo> SubDirectories;
        public Dictionary<int, String> Files;
        public String Name;
        public String pFullPath; // So we can get{}/set{}!
        public String FullPath
        {
            set
            {

                // We can only check if it's atleast 1 char long...
                if (value.Length >= 1)
                    // Does it have a trailling slash?
                    if (value.Substring(value.Length - 1, 1) != "\\")
                        // add it
                        value += "\\";

                // Set the private variable
                pFullPath = value;

            }
            get
            {

                // Just return it
                return pFullPath;

            }
        }
        private String pRelativePath; // Use a get{}/set{} to add trailling slash...
        public String RelativePath
        {
            set
            {

                // We can only check if it's atleast 1 char long...
                if (value.Length >= 1)
                    // Does it have a trailling slash?
                    if (value.Substring(value.Length - 1, 1) != "\\")
                        // add it
                        value += "\\";

                // Set the private variable
                pRelativePath = value;

            }
            get
            {

                // Just return it
                return pRelativePath;

            }
        }

        // Constructor
        public DirectoryInfo()
        {
            SubDirectories = new Dictionary<int, DirectoryInfo>();
            Files = new Dictionary<int, string>();
        }

        // Add Subdirectory
        public void AddSubDirectory(DirectoryInfo Dir)
        {
            SubDirectories.Add(SubDirectories.Count, Dir);
        }

        // Add File
        public void AddFile(String File)
        {
            Files.Add(Files.Count, File);
        }

    }
}
